import 'package:flutter/material.dart';
class ButtonPage extends StatefulWidget {
  const ButtonPage({super.key, required this.title});


  final String title;

  @override
  State<ButtonPage> createState() => _ButtonPageState();
}
class _ButtonPageState extends State<ButtonPage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }
  void _onPressed() {
    print("点击事件");
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child:  Column(
          children: [
            // 漂浮按钮 带有背景
            ElevatedButton(
              child: Text("normal"),
              onPressed: () {},
            ),

            // 只有文本
            TextButton(
              child: Text("normal"),
              onPressed: () {},
            ),

            // 外边框
            OutlinedButton(
              child: Text("normal"),
              onPressed: () {},
            ),

            // 图标按钮
            IconButton(
              icon: Icon(Icons.thumb_up),
              onPressed: () {},
            ),
            ElevatedButton.icon(
              icon: Icon(Icons.send),
              label: Text("发送"),
              onPressed: _onPressed,
            ),
            OutlinedButton.icon(
              icon: Icon(Icons.add),
              label: Text("添加"),
              onPressed: _onPressed,
            ),
            TextButton.icon(
              icon: Icon(Icons.info),
              label: Text("详情"),
              onPressed: _onPressed,
            ),// 带图标得按钮
          ],
        )
      )
    );
  }
}